//姓名：尹权松
//学号：202102907
package Step1;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class SenderDemo1 {
    public static void main(String[] args) throws Exception {

        Socket socket = new Socket(InetAddress.getByName("192.168.0.193"), 9000);
        OutputStream os = socket.getOutputStream();
        File file = new File("D:\\QLDownload\\新神榜：杨戬\\新神榜：杨戬 4K(超高清SDR).qlv");
        FileInputStream fis = new FileInputStream(file);
        byte[] buffer = new byte[1024];
        int len;
        while ((len = fis.read(buffer)) != -1) {
            os.write(buffer, 0, len);
            Thread.sleep(1);
        }
        fis.close();
        os.close();
        socket.close();

    }
}